package GUI;

import java.awt.Color;
import java.beans.PropertyVetoException;
import java.util.ArrayList;

import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;
import javax.swing.JButton;

import Client.FlowerMain;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;
/**
 * This class create  Reports GUI
 * @author Gabi Revah
 * @author Aviad Almog
 */
public class Reports extends ManagerWindow { 
	/**
	 * Reports constructor 
	 * @throws PropertyVetoException
	 */
	public Reports() throws PropertyVetoException  {
		
		initComponents();	
	}
/**
 * Initiate the Reports window 
 */
	private void initComponents()  {
		
		setBackground(new Color(135, 206, 250));
		setLayout(null);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
		lblNewLabel.setIcon(new ImageIcon(Reports.class.getResource("/images/statistics (1).png")));
		lblNewLabel.setBounds(502, 336, 448, 215);
		add(lblNewLabel);
		
		JButton btnRentPerCustomer = new JButton("\u05D3\u05D5\"\u05D7 \u05D4\u05E9\u05DB\u05E8\u05D5\u05EA \u05DC\u05DC\u05E7\u05D5\u05D7");
		btnRentPerCustomer.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				ArrayList<String> AddArray=new ArrayList<String>();
				AddArray.add("GetRentBuss");
				FlowerMain.chat.handleMessageFromGui(AddArray);
			}
		});
		btnRentPerCustomer.setFont(new Font("Tahoma", Font.BOLD, 20));
		btnRentPerCustomer.setBounds(292, 70, 243, 74);
		add(btnRentPerCustomer);
		
		JButton btnInventoryRent = new JButton("\u05D3\u05D5\"\u05D7 \u05D4\u05E9\u05DB\u05E8\u05D5\u05EA");
		btnInventoryRent.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				SaleReport sr = null;
				
				try {
					sr = new SaleReport();
				} catch (PropertyVetoException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
			
			MainScreen.card.add("SaleReport", sr);
			MainScreen.cardLayot.show(MainScreen.card, "SaleReport");
				
			}
		});
		btnInventoryRent.setFont(new Font("Tahoma", Font.BOLD, 20));
		btnInventoryRent.setBounds(292, 294, 243, 64);
		add(btnInventoryRent);
		
		JButton btnOrders = new JButton("\u05D3\u05D5\"\u05D7 \u05DE\u05DB\u05D9\u05E8\u05D5\u05EA");
		btnOrders.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
				OrderReport or = null;
				
					try {
						or = new OrderReport();
					} catch (PropertyVetoException e1) {
						// TODO Auto-generated catch block
						e1.printStackTrace();
					}
				
				MainScreen.card.add("OrderReport", or);
				MainScreen.cardLayot.show(MainScreen.card, "OrderReport");
				
			}
		});
		btnOrders.setFont(new Font("Tahoma", Font.BOLD, 20));
		btnOrders.setBounds(292, 180, 243, 64);
		add(btnOrders);

} 
}


